package cn.wolfcode.service;

import cn.wolfcode.doamin.Employee;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface IEmployeeService  extends IService<Employee> {
//    void save(Employee employee);
//
//    void update(Employee employee);
//
//    void delete(Long id);
//
//    Employee get(Long id);
//
//    List<Employee> list();
@Select("select e.* from employee e")
List<Employee> listByAnnoSingle();
    @Select("select e.*, d.id d_id, d.name d_name, d.sn d_sn from employee e left join department d on e.dept_id = d.id")
    @Results({@Result(column="d_id", property = "dept.id"),
            @Result(column="d_name", property = "dept.name"),
            @Result(column="d_sn", property = "dept.sn") })
    List<Employee> listByAnnoJoin();
}
